package com.facebook.listener;

import android.app.Activity;
import android.os.Handler;
import android.widget.Toast;

import com.facebook.android.FacebookError;
import com.imoblife.brainwavestus.share.BaseRequestListener;

public class FQLRequestListener extends BaseRequestListener {

	private Activity mActivity;
	private Handler mHandler;

	public FQLRequestListener(){}
	
	public FQLRequestListener(Activity activity) {
		this.mActivity = activity;
		mHandler = new Handler();
	}

	public void onComplete(final String response, final Object state) {
		mHandler.post(new Runnable() {
			public void run() {
				Toast.makeText(mActivity.getApplicationContext(),
						"Response: " + response, Toast.LENGTH_LONG).show();
			}
		});
	}

	public void onFacebookError(FacebookError error) {
		Toast.makeText(mActivity.getApplicationContext(),
				"Facebook Error: " + error.getMessage(), Toast.LENGTH_LONG)
				.show();
	}
}
